package com.k.kc.util;

import java.io.*;
import java.nio.charset.Charset;

/**
 * @author k
 */
public class RegExUtils {


    /**
     * <code>String r = getExcelErrorMsg("sheet:{} row:{} col:{} err:{}",1,2,3,"can not empty");</code>
     * @param keyFormat
     * @param sheet
     * @param row
     * @param col
     * @param msg
     * @return
     */
    public static String getExcelErrorMsg(String keyFormat,int sheet,int row,int col,String msg){
        String format = keyFormat.replaceAll("\\{[^}]*\\}","%s");
        return String.format(format,sheet,row,col,msg);
    }
    public static void main(String[] args) {
        System.out.println(getExcelErrorMsg("sheet:{},row{},col:{},msg:{}",1,2,3,"xxxerr"));
        System.out.println(getExcelErrorMsg("sheet:{},row{},col:{},msg:{}",1,2,3,"xxxerr"));
    }
}
